package com.mvp.common;

import com.mvp.utils.SharedPreferencesUtils;

import timber.log.Timber;

/**
 * Created by zhangyuncai on 2018/9/11.
 */

public class GlobalValue {


    public static final int records = 10;//每一页的数量

    public static boolean isDebug = true;//是否是测试模式

//        public static final String H5_Url_Test = "http://192.168.2.99:1111";
//    public static final String H5_Url_Com = "https://asia.wusfamily.cn";//正式地址
    public static final String H5_Url_Com = "https://h5.asia5b.com";//正式地址
    //        public static final String H5_Url_Test = "http://wusfamily.cn:1112";//测试地址
    public static final String H5_Url_Test = "http://h5.asia5b.com:1112";//测试地址
    public static String H5_Url = H5_Url_Test;
    public static final String Base_Version_Url = "/api/mobile-v1/";
    //正式环境
    public static final String BASE_API_URL_COM = "https://asia-allnet.com/";////正式地址
    public static final String BASE_API_URL_TEST = "https://api.gim-allnet.com/";//测试地址
    //    public static final String BASE_API_URL_TEST = "http://java.gim-allnet.com/";//java商城测试地址
    public static String BASE_API_URL = BASE_API_URL_TEST;
    //    public static final String BASE_PAYMENT_THIRD_URL = "https://asia-allnet.com:8000/";
//    public static final String BASE_PAYMENT_THIRD_URL = "https://www.asia6b.com/";
    //第三方提交地址
    public static final String BASE_PAYMENT_THIRD_URL_TEST = "https://gim-allnet.com:8000/";//测试地址
    public static final String BASE_PAYMENT_THIRD_URL_COM = "https://www.asia5b.com/";////正式地址
    public static String BASE_PAYMENT_THIRD_URL = BASE_PAYMENT_THIRD_URL_TEST;


    public static final String IS_FIRST_ENTER_APP = "IS_FIRST_ENTER_APP";
    public static final String IS_FIRST_SET_LANGUAGE = "IS_FIRST_SET_LANGUAGE";//是否第一次设置语言

    //默认是第一次
    public static boolean isFirstSetLanguage() {
        return (boolean) SharedPreferencesUtils.getData(GlobalValue.IS_FIRST_SET_LANGUAGE, true);
    }

    public static void saveFirstSetLanguage(boolean isFirstSetLanguage) {
        SharedPreferencesUtils.putData(GlobalValue.IS_FIRST_SET_LANGUAGE, isFirstSetLanguage);
    }

    //默认是第一次
    public static boolean isFirstLaunch() {
        return (boolean) SharedPreferencesUtils.getData(GlobalValue.IS_FIRST_ENTER_APP, true);
    }

    public static void saveFirstLaunch(boolean launch) {
        Timber.d("--->>>>>>>>---save:" + launch);
        SharedPreferencesUtils.putData(GlobalValue.IS_FIRST_ENTER_APP, launch);
    }

    //计算总页数
    public static int getSumPage(int limitPage, int total) {
        return total % limitPage == 0 ? total / limitPage : total / limitPage + 1;
    }
}
